package cn.sjlink.util;

import java.util.Random;

public class CaptchaUtil {

    private static final String NUMBER_CHAR = "0123456789";

    public static String getCaptcha(Integer length){
        StringBuffer sb = new StringBuffer();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            sb.append(NUMBER_CHAR.charAt(random.nextInt(NUMBER_CHAR.length())));
        }
        return sb.toString();
    }
}
